package day06;


//	 父类静态代码块>子类静态代码块>子类静态方法>父类非静态代码块>父类构造方法>子类非静态代码块>子类构造方法


public class MethodDemo extends MethodDemoFather {
    public MethodDemo() {
        System.out.println("子类默认构造方法");
    }

    static {
        MethodDemoFather.demo();
        System.out.println("子类静态代码块");
    }

    {
        System.out.println("子类非静态代码块");
    }
    public static void demo(){
        System.out.println("子类静态方法");
    }
    public void father(){
        System.out.println("子类一般方法");
    }
    public static void main(String[] args) {
        MethodDemoFather.demo();
        MethodDemo methodDemo = new MethodDemo();
        methodDemo.demo();
        methodDemo.father();



//        sayHello("dqh", 20);
//
//        System.out.println(add(99, max(98,99)));

    }
}

//    public static void sayHello(String name, int age) {
//        System.err.println("大家好，我叫" + name + "今年" + age + "岁了");
//    }
//
//    public static int add(int num1, int num2) {
//        return num1 + num2;
//    }
//    public static int max(int num1,int num2){
//        return num1>num2?num1:num2;
//    }
//
//}
